import { createBrowserRouter } from "react-router-dom";
import { Navigate } from "react-router-dom";
import App from "../App";
//通讯录页面
import AddressBook from "../鹏总/AddressBook";
import Mywork from "../鹏总/Mywork";
import AddZh from "../鹏总/addZh";
import Home from "../Home";
import Guan from "../鹏总/Guan";
import Geng from "../鹏总/Geng";
//我的界面信息
import My from "../pages/My";
import Myplg from "../pages/Myplg";
// 医疗协作界面
import MedicalLayout from '../pages/Medical/Layout';
import ConsultationList from '../pages/Medical/Consultation/';
import ConsultationNew from '../pages/Medical/Consultation/New';
import ConsultationDetail from '../pages/Medical/Consultation/Detail'
import ReferralList from '../pages/Medical/Referral';
import ReferralDetail from '../pages/Medical/Referral/index';
import Zhuan from '../pages/Medical/Referral/zhuan'


// 登录信息

import Login from "../props/Login"
import YiLoginLian from "../props/YiLoginLian"
import YiLoginDong from "../props/YiLoginDong"
import YiLoginDian from "../props/YiLoginDian"
import Wxin from "../props/Wxin"
import QtLogin from "../props/QtLogin"

// 工作平台信息
import For from '../page/ForWork'
import Bin from '../page/Bin'
import Add from '../page/AddPatient'
import Health from '../page/HealthManagement'

// 工作平台 群聊界面
import Three from '../views/Three'
import Xiao from '../views/Xiao'
import Fen from '../views/Fen'
import Qun from '../views/Qun'
import Suo from '../views/Suo'

const router = createBrowserRouter([
  // 登录信息
  { path: "/login", element: <Login></Login> },
  { path: "/LT", element: <YiLoginLian></YiLoginLian> },
  { path: "/YD", element: <YiLoginDong></YiLoginDong> },
  { path: "/DX", element: <YiLoginDian></YiLoginDian> },
  { path: "/wxin", element: <Wxin></Wxin> },
  { path: "/qtLogin", element: <QtLogin></QtLogin> },
  {
    path: "/",
    element: <App />,
    children: [
      // 工作台
      { path: '/forWork', element: <For /> ,
      
         
      
      },
      {  path:'/health',element:<Health></Health> },
      { path: '/add', element: <Add /> },
      { path: '/bin', element: <Bin /> },
      // 我的信息界面配置
      { path: '/my', element: <My /> },
      { path: "/myplg", element: <Myplg /> },
      { path: "/guan", element: <Guan></Guan> },
      { path: "/geng", element: <Geng></Geng> },
      {
        // 医疗协作
        path: "layout",
        element: <MedicalLayout />,
        children: [
          {
            path: "consultation",
            children: [
              { index: true, element: <ConsultationList /> },
              { path: "new", element: <ConsultationNew /> },
              { path: "edit", element: <ConsultationDetail /> },
            ],
          },
          {
            path: "referral",
            children: [
              { index: true, element: <ReferralList /> },
              { path: 'zhuan', element: <Zhuan /> },
              { path: ":id", element: <ReferralDetail /> },
            ],
          },
        ],
      },
      {
        // 通讯录
        path: "txl",
        element: <AddressBook />,
        children: [
          { index: true, element: <Navigate to="mywork" /> },
          { path: "mywork", element: <Mywork /> },
          { 
            path: "three", 
            element: <Three />,
            children: [
              { path: "xiao", element: <Xiao /> },
              { path: "fen", element: <Fen /> },
              { path: "qun", element: <Qun /> },
              { path: "suo", element: <Suo /> },
            ]
          },
        ],
      },
      // 添加我的患者
      { path: "/addzh", element: <AddZh></AddZh> },

    ],
  },
]);
export default router;
